﻿using System;
using System.Xml.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Schemas = SchemasLib;
using System.Linq;
//using AcessaDadosBD.Repositorios;
//using AcessaDadosBD;

namespace TestProject
{
    [TestClass]
    public class SchemaUnitTest
    {
        [TestMethod]
        public void TestMethod1()
        {
            //var cabecalho = new Schemas.cabecalhoTransacao();
            //cabecalho.identificacaoTransacao = new Schemas.cabecalhoTransacaoIdentificacaoTransacao();
            //cabecalho.identificacaoTransacao.tipoTransacao = Schemas.st_tipoTransacao.ENVIO_LOTE_GUIAS;
            //cabecalho.identificacaoTransacao.sequencialTransacao = "21";
            //cabecalho.identificacaoTransacao.dataRegistroTransacao = new DateTime(2010, 12, 21);
            //cabecalho.identificacaoTransacao.horaRegistroTransacao = new DateTime(2010, 12, 21, 14, 24, 29);
            //cabecalho.origem = new Schemas.cabecalhoTransacaoOrigem();
            //cabecalho.origem.ItemElementName = Schemas.ItemChoiceType1.registroANS;
            //cabecalho.origem.Item = "123456";
            //cabecalho.destino = new Schemas.cabecalhoTransacaoDestino();
            //cabecalho.destino.ItemElementName = Schemas.ItemChoiceType2.registroANS;
            //cabecalho.destino.Item = "353535";
            //cabecalho.versaoPadrao = new Schemas.st_versao();
            //cabecalho.versaoPadrao = Schemas.st_versao.Item20203;
            //cabecalho.identificacaoSoftwareGerador = new Schemas.ct_identificacaoSoftwareGerador();
            //cabecalho.identificacaoSoftwareGerador.nomeAplicativo = "LiveTiss";
            //cabecalho.identificacaoSoftwareGerador.versaoAplicativo = "1.0.0";
            //cabecalho.identificacaoSoftwareGerador.fabricanteAplicativo = "LTIA";
            //cabecalho.falhaNegocio = new Schemas.cabecalhoTransacaoFalhaNegocio();
            //cabecalho.falhaNegocio.codigoGlosa = new Schemas.st_tipoGlosa();

            //XmlSerializer serializer = new XmlSerializer(cabecalho.GetType());
            //System.IO.MemoryStream ms = new System.IO.MemoryStream();
            
            //serializer.Serialize(ms, cabecalho);

            //byte[] bytes = ms.ToArray();
            //ms.Close();
            //string s = System.Text.Encoding.UTF8.GetString(bytes, 0, bytes.Length);
        }
    }
}
